package com.token.iot.bratterycharging.gateway.api;

import java.io.Serializable;

import com.outstanding.framework.core.EntityObject;

/**
 * String signal = val.substring(14, length); //loger.info(" the ping signal=" +
 * signal); String wuma = val.substring(length + 1, length + 2); //loger.info("
 * the ping wuma=" + wuma); int post = val.lastIndexOf("#/#"); String
 * lastresponse = val.substring(length + 5, post); //loger.info(" the ping
 * lastresponse=" + lastresponse); String signalType = val.substring(post + 3,
 * val.length());
 * 
 * @author chenzhixuan
 *
 */
public class Ping extends EntityObject implements  Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 710157513391511085L;
	private String imei;
	private String signal;
	private String wuma;
	private String lastResponse;
	private String signalType;
	private String ip;
	private String ymd;
	
	
	

	public String getYmd() {
		return ymd;
	}

	public void setYmd(String ymd) {
		this.ymd = ymd;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public static Ping build(String command) {
		Ping p = new Ping();
		int length = command.indexOf(",");
		String signal = command.substring(14, length);
		// loger.info(" the ping signal=" + signal);
		String wuma = command.substring(length + 1, length + 2);
		// loger.info(" the ping wuma=" + wuma);
		int post = command.lastIndexOf("#/#");
		String lastResponse = command.substring(length + 5, post);
		// loger.info(" the ping lastresponse=" + lastresponse);
		String signalType = command.substring(post + 3, command.length());
		
		p.setSignal(signal);
		p.setSignalType(signalType);
		p.setWuma(wuma);
		p.setLastResponse(lastResponse);
		return p;
		
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getSignal() {
		return signal;
	}

	public void setSignal(String signal) {
		this.signal = signal;
	}

	public String getWuma() {
		return wuma;
	}

	public void setWuma(String wuma) {
		this.wuma = wuma;
	}

	public String getLastResponse() {
		return lastResponse;
	}

	public void setLastResponse(String lastResponse) {
		this.lastResponse = lastResponse;
	}

	public String getSignalType() {
		return signalType;
	}

	public void setSignalType(String signalType) {
		this.signalType = signalType;
	}

}
